function NoMusicToast(variable){
  console.log("确认git")
  if(variable == "") {
    wx.showToast({
     title:"暂无音源,请先上传..." ,
     icon:"none"
    })
    return true;
  }
}

function BGPlayer(options){


  console.log(options , encodeURI(options.book_book_url))

  const backgroundAudioManager = wx.getBackgroundAudioManager();

    if (!options.audioFlag || options.book_book_url == "") return

    //后台播放音乐

    backgroundAudioManager.title = options.article_title || "暂无";
    backgroundAudioManager.epname = options.book_title || "暂无";
    backgroundAudioManager.singer = options.reader_link || "暂无";

    backgroundAudioManager.coverImgUrl = options.book_logo;
    // // 设置了 src 之后就会自动播放，若此处不设置src默认将为空字符串，当设置了src可以播放音乐
    backgroundAudioManager.src = encodeURI(options.book_book_url);
    
    backgroundAudioManager.seek(options.book_audio_date);



}


module.exports = {
  NoMusicToast ,
  BGPlayer
}